<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>点餐系统</title>
<meta name="Keywords" content="点餐系统">
<meta name="Description" content="点餐系统">
<link href="__CSS_ADMIN_PATH__/css.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC_PATH__/fancybox/source/jquery.fancybox.css" rel="stylesheet" type="text/css">
<script src="__JS_PATH__/jquery-1.8.3.js" type="text/javascript"></script>
<script src="__PUBLIC_PATH__/fancybox/source/jquery.fancybox.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('.fancybox').fancybox();
	});
	
	function fancyboxClose(){	
		$.fancybox.close(); 
	}
</script>
</head>
<body>
<script language="javascript">
window.onload=function showtable(){
var tablename=document.getElementById("mytable");
var li=tablename.getElementsByTagName("tr");
var i=0;
for (i=0;i<=li.length-1;i++){
	li[i].style.backgroundColor="#fff";
	li[i].onmouseover=function(){
	this.style.backgroundColor="#f8f4f1";
}
	li[i].onmouseout=function(){
	this.style.backgroundColor="#fff"
}
}
}

/**
* 全选checkbox,注意：标识checkbox id固定为为check_box
* @author Tony
* @param string name 列表check名称,如 uid[]
*/
function selectall(name) {
	if ($("#check_box").attr("checked")=='checked') {
		$("input[name='"+name+"']").attr("checked","checked");
		$('.checkall').attr("checked"=='checked');
	} else {
		$("input[name='"+name+"']").removeAttr("checked");
		$('.checkall').removeAttr("checked");
	}
}
function confirm_delete(){
	if(confirm('确认删除吗？')) $('#myform').submit();
}
function confirmurl(url,str){
	if(confirm(str)){
	 location.href=url;
	}
}
//列表中修改单一数据的各种状态 added by Tony
function fetch_ajax(par,id){
	var imgUrl = '/Public/Admin/images/';
	var statusVal = $('#'+par+id).attr ('status');
	var value = $('#'+par+id).attr ('value');
	if(statusVal == 1){
	var imgName = 'no.gif';
	var status = 0;
	}else{
	var imgName = 'yes.gif';
	var status = 1;
	}
	if(statusVal!=1){
		if(confirm('你确定要改变桌位的状态吗？')){
			$.post('/index.php?g=Admin&m=Table&a=modifStatus',{'id':id,'value':value},function(re){
				if(re == 1){
					$('.tabStatus'+id).attr('status',0).attr('src',imgUrl+'no.gif');
					$('#'+par+id).attr ('status',status);
					$('#'+par+id).attr ('src',imgUrl+imgName);
				}
			});
		}
	}
} 
</script>

<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="mart15">
  <tr>
    <td width="4"><img src="__IMG_ADMIN_PATH__/gk1.png" width="4" height="39" /></td>
    <td background="__IMG_ADMIN_PATH__/gk2.png"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="23" class="xtgk2"><img src="__IMG_ADMIN_PATH__/gk_1.png" width="16" height="16" /></td>
        <td class="xtgk1"> <?php echo ($title); ?>操作员信息</td>
      </tr>
    </table></td>
    <td width="5"><img src="__IMG_ADMIN_PATH__/gk3.png" width="5" height="39" /></td>
  </tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dca581">
  <tr>
    <td valign="top" bgcolor="#FFFFFF"><form id="myform" name="myform" method="post" action="/index.php?g=Admin&m=System&a=editAdmin">
		<input name="targetid" type="hidden" id="targetid" value="<?php echo ($info["id"]); ?>" />
      <table width="95%" id="mytable" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#efddd2" class="mart15 marb15 color333">
        <tr>
          <td align="right" bgcolor="#f5ede6">账户名</td>
          <td bgcolor="#FFFFFF"><h1><font style="color:red; margin:3px;">*</font>
            <input type="text" name="adminuser" id="adminuser" value="<?php echo ($info["adminuser"]); ?>"  class="input1" />(尽量不要使用中文)
          </h1></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#F5EDE6">密码</td>
          <td bgcolor="#FFFFFF"><font style="color:red; margin:3px;">*</font>
            <input type="password" name="password" id="password" class="input1" />
			</td>
        </tr>
        <tr>
          <td align="right" bgcolor="#F5EDE6">确认密码</td>
          <td bgcolor="#FFFFFF"><font style="color:red; margin:3px;">*</font><input type="password" name="repassword" id="repassword" class="input1" /></td>
        </tr>
		<tr>
          <td align="right" bgcolor="#F5EDE6">昵称</td>
          <td bgcolor="#FFFFFF"><font style="color:red; margin:3px;">*</font><input type="text" name="nickname" id="nickname" class="input1" value="<?php echo ($info["nickname"]); ?>" /></td>
        </tr>
		<tr>
          <td align="right" bgcolor="#F5EDE6">权限/状态</td>
          <td bgcolor="#FFFFFF"><p><font style="color:red; margin:3px;">*</font>
		  	<label typeid="1" class="clickPermission">
              <input type="radio" value="1" id="groupid_1" name="groupid" <?php if($info["groupid"] == 1): ?>checked="checked"<?php endif; ?>>
              超级管理员</label>
			<label typeid="2" class="clickPermission">
              <input type="radio" value="2" id="groupid_2" name="groupid" <?php if($info["groupid"] == 2): ?>checked="checked"<?php endif; ?>>
              普通管理员</label>
			<font style="color:red; margin:3px;">/</font>
            <label>
              <input name="roleid" type="radio" id="roleid_1" value="normal" <?php if($info["roleid"] == 1): ?>checked="checked"<?php endif; ?>/>
              正常</label>
            <label>
              <input type="radio" name="roleid" value="forbidden" id="roleid_0" <?php if($info["roleid"] == 0): ?>checked="checked"<?php endif; ?>/>
              禁用</label>
            <br />
          </p></td>
        </tr>	
		<tr id="clickPermission" <?php if($info['groupid'] == '1'): ?>style="display:none;"<?php endif; ?>>
          <td align="right" bgcolor="#F5EDE6">分配权限</td>
          <td bgcolor="#FFFFFF">
		  <?php if(is_array($menuOriginal)): $i = 0; $__LIST__ = $menuOriginal;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($v['show'] != 1): ?><input type="checkbox" id="permission_<?php echo ($v["id"]); ?>" class="actionView" name="permission[]" value="<?php echo ($v["id"]); ?>"/><?php echo ($v["name"]); ?> >>
			<span id="function_<?php echo ($v["id"]); ?>">
			<?php if(is_array($v["view"])): $i = 0; $__LIST__ = $v["view"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i; if($vv['show'] != 1): ?><span style="margin-left:5px;">
			  <input type="checkbox" id="permission_<?php echo ($vv["id"]); ?>" parentid="<?php echo ($v["id"]); ?>" class="functionView parentid_<?php echo ($v["id"]); ?>" name="permission[]" value="<?php echo ($vv["id"]); ?>"/><?php echo ($vv["name"]); ?>
			  </span><?php endif; endforeach; endif; else: echo "" ;endif; ?>
		  </span>
		  <br /><?php endif; endforeach; endif; else: echo "" ;endif; ?>	
		</td>
        </tr>
        <tr>
          <td align="right" bgcolor="#F5EDE6">邮箱</td>
          <td bgcolor="#FFFFFF"><label for="select">
            <input type="text" name="email" id="email" class="input1" value="<?php echo ($info["email"]); ?>" />
          </label></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#F5EDE6">手机号</td>
          <td bgcolor="#FFFFFF"><label for="select">
            <input type="text" name="phone" id="phone" class="input1" value="<?php echo ($info["phone"]); ?>" />
          </label></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#F5EDE6">座机</td>
          <td bgcolor="#FFFFFF"><label for="select">
            <input type="text" name="tel" id="tel" class="input1" value="<?php echo ($info["tel"]); ?>" />
          </label></td>
        </tr>
        <tr>
          <td colspan="2" align="center" bgcolor="#FFFFFF" ><input type="submit" name="button" id="button" value="提交" class="input10" /></td>
        </tr>
      </table>
    </form></td>
        </tr>
      </table></td>
  </tr>
</table>
<script>
	var permissionStr = '<?php echo ($permission); ?>';
	if(permissionStr){
		var permissionArray = permissionStr.split(',');
		for(var i=0;i<permissionArray.length;i++){
			$('#permission_'+permissionArray[i]).attr('checked',true);
		}
	}
	//控制类权限	added by Tony
	$('.actionView').click(function(){
		var ifChecked = $(this).attr('checked');
		var parentid = $(this).val();
		if(ifChecked == 'checked'){
			$(this).attr('checked',true);
			$('.parentid_'+parentid).attr('checked',true);
		}else{
			$(this).attr('checked',false);
			$('.parentid_'+parentid).attr('checked',false);
		}
	});
	//控制方法权限	added by Tony
	$('.functionView').click(function(){
		var ifChecked = $(this).attr('checked');
		var parentid = $(this).attr('parentid');
		if(ifChecked == 'checked'){
			$(this).attr('checked',true);
			$('#permission_'+parentid).attr('checked',true);
		}else{
			var checkedLenght = $(".parentid_"+parentid+':checked').length;
			if(checkedLenght < 1){
				$(this).attr('checked',false);
				$('#permission_'+parentid).attr('checked',false);
			}
		}
	});
	
	$('.clickPermission').click(function(){
		var type = $(this).attr('typeid');
		if(type == 1){
			$('#clickPermission').hide();
		}else if(type == 2){
			$('#clickPermission').show();
		}
	});
</script>
<STYLE type=text/css media=screen>
ul{ padding:0px; margin:0px;}
#downmsg_emessage {Z-INDEX: 100; RIGHT: 0px; BACKGROUND: url(__IMG_ADMIN_PATH__/down_msg_bg.gif) no-repeat left top; WIDTH: 225px; BOTTOM: 0px; POSITION: fixed; _position: absolute}
#donwmsg_head {MARGIN-TOP: 1px; DISPLAY: inline; FONT-SIZE: 12px; FLOAT: left; MARGIN-LEFT: 26px; COLOR: #ffffff}
#downmsgBar .close {MARGIN-TOP: 6px; DISPLAY: block; FLOAT: right; WIDTH: 11px; MARGIN-RIGHT: 5px; HEIGHT: 11px}
#downmsgBar {HEIGHT: 25px}
#donwmsg_content {OVERFLOW: hidden; HEIGHT: 162px}
#donwmsg_content UL {PADDING-RIGHT: 10px; height:68%; PADDING-LEFT: 10px; FONT-SIZE: 12px; LEFT: 6px; PADDING-BOTTOM: 0px; COLOR: #007cc1; LINE-HEIGHT: 180%; PADDING-TOP: 10px; TOP: 34px}
#donwmsg_content UL LI {BACKGROUND: url(__IMG_ADMIN_PATH__/down_msg_bg.gif) no-repeat -100px -245px; TEXT-INDENT: 13px}
#donwmsg_content UL LI A {COLOR: #007cc1}
#donwmsg_content UL .ll A {	FONT-WEIGHT: bold; COLOR: #a10000}
#donwmsg_content P {LEFT: 13px; POSITION: absolute; TOP: 157px}
#donwmsg_content .lb {PADDING-RIGHT: 14px; PADDING-LEFT: 14px; PADDING-BOTTOM: 14px; PADDING-TOP: 14px; TEXT-ALIGN: center}
#donwmsg_content .lb a{ font-size:13px;}
.msg-hidden-btn-2 {MARGIN-TOP: 6px; DISPLAY: block; BACKGROUND: url(__IMG_ADMIN_PATH__/down_msg_bg.gif) no-repeat left -250px; FLOAT: right; OVERFLOW: hidden; WIDTH: 11px; MARGIN-RIGHT: 5px; HEIGHT: 11px}
.msg-hidden-btn-1 {MARGIN-TOP: 6px; DISPLAY: block; BACKGROUND: url(__IMG_ADMIN_PATH__/down_msg_bg.gif) no-repeat -50px -250px; FLOAT: right; OVERFLOW: hidden; WIDTH: 11px; MARGIN-RIGHT: 5px; HEIGHT: 11px}
.sectionshover .trans {	BORDER-RIGHT: #ffc600 1px solid; BORDER-TOP: #ffc600 1px solid; BORDER-LEFT: #ffc600 1px solid; BORDER-BOTTOM: #ffc600 1px solid; HEIGHT: 24px; BACKGROUND-COLOR: #fff0b6
}
.sectionshover .trans LI {CLEAR: none; FLOAT: left; WIDTH: 200px}
.mm_gg LI {PADDING-LEFT: 15px; BACKGROUND: url(__IMG_ADMIN_PATH__/1254189745035.gif) no-repeat 4px 8px; LINE-HEIGHT: 20px}
.mm_gg LI A {COLOR: #8f3434}
.mm_gg LI A:hover {	COLOR: #8f3434}
.mm_gg LI:visited {COLOR: #8f3434}
</STYLE>
<script src="__JS_ADMIN_PATH__/jsc.js" type="text/javascript"></script>
<script src="__JS_ADMIN_PATH__/lightbox.js" type="text/javascript"></script>
<DIV id=downmsg_emessage style="DISPLAY: none ">
    <DIV id=downmsgBar>
        <DIV id=donwmsg_head>系统提示</DIV>
        <A class=close href="javascript:closeDiv()"></A>
        <A class=msg-hidden-btn-1 id=msg_hidden_btn href="javascript:showHideDiv()">&nbsp;</A>
    </DIV>
    <DIV id=donwmsg_content>
          <UL id="settleShow">
          </UL>
          <DIV class=lb>请赶往处理!</DIV>
    </DIV>
</DIV>
<script src="__JS_ADMIN_PATH__/down_msg.js" type="text/javascript"></script>
<SCRIPT type=text/javascript>
var downmsg = new downMsg("downmsg_emessage","donwmsg_content",{start_delay:2000, speed: 5, movepx:2,cookie:'downMsgcookie',expiresDay:1});
	window.setInterval(getSettle, 30000);//每隔30秒获取一次
//自动获取请求表数据	added by Tony
function getSettle(){
	$.post('/index.php?g=Admin&m=Login&a=getSettle','',function(html){
		var htmlLength = html.length;
		if(htmlLength){
			$('#settleShow').html(html);
			var msg_hidden_btn = $('#msg_hidden_btn').hasClass('msg-hidden-btn-1');
			if(msg_hidden_btn){
				downmsg.start();
				setTimeout('closeDiv()',10000);
			}
		}
	});
}
</SCRIPT>
</body></html>